![]() |
PATH![]() |
![]() ![]() |
A literal expression is an expression that evaluates to itself. The "Literal Expressions" section of a value class definition provides examples of how values of a particular class are represented in AppleScript--that is, typical literal expressions for values of that class. For example, in AppleScript and many other programming languages, the literal expression for a string is a series of characters enclosed in quotation marks. The quotation marks are not part of the string value; they are a notation that indicates where the string begins and ends. The actual string value is a data structure stored in AppleScript.
The following example, from the definition for the List value class, shows a literal expression for a list value, which is a composite-value type.
{ "it's", 2, true }
As with the quotation marks in a string literal expression, the braces that enclose the list and the commas that separate its items are not part of the actual list value; they are notations that represent the grouping and items of the list. The list class is described fully in List.